package com.sharp.core.math.primitives;

import com.sharp.core.graphics.Material;
import com.sharp.core.math.Matrix;
import com.sharp.core.math.Vec3;
import com.sharp.core.raytrace.Ray;

public abstract class Primitive extends Object3D {
	
	private Material material;
	
	public abstract float intersect(Ray ray);
	public abstract Vec3 normal(Vec3 pos);

	public Primitive() {
		material = new Material();
	}

	public void transform(Matrix m) {
		m.transform(getPos());
	}
	
	public Material getMaterial() {
		return material;
	}

	public void setMaterial(Material material) {
		this.material = material;
	}
	
	public boolean isLight() {
		return false;
	}
	
	
	@Override
	public String toString() {
		return getPos()+", " + getMaterial();
	}
} 
